package com.tjtt.tdm.system.action;

import java.io.IOException;
import java.sql.Timestamp;

import javax.servlet.http.HttpSession;

import com.tjtt.tdm.base.BaseAction;
import com.tjtt.tdm.exception.ServiceException;
import com.tjtt.tdm.system.bean.TdmMessage;
import com.tjtt.tdm.system.service.MessageService;

public class SysMessageAction extends BaseAction{
	
	private MessageService messageService;
	public MessageService getMessageService() {
		return messageService;
	}


	public void setMessageService(MessageService messageService) {
		this.messageService = messageService;
	}

	private String tcNotice;
	private String tcNoticeContent;
	private String tcType;
	private String tcNoticeTime;
	private String tcNoticeDepart;
	private String tcNoticePerson;

	
	

	public String GetMessageList()
	{
		HttpSession session = this.getRequest().getSession();
		String userID = session.getAttribute("userID").toString();
		String departID = session.getAttribute("departID").toString();
		
		return "";
	}
	
	
	/**
	 * 保存信息
	 * @return
	 * @throws IOException
	 * @throws ServiceException
	 */
	public String AddMessage() throws Exception {
		try {
				TdmMessage message = new TdmMessage();
				message.setTmNotice(tcNotice);
				message.setTmDepts(tcNoticeDepart);
				message.setTmInputTime(new Timestamp(System.currentTimeMillis()));
				message.setTmNoticeType(tcType);
				message.setTmUsers(tcNoticePerson);
				return "";
		}catch (Exception e) {
			return "";
		}
	}
	
	public String getTcNotice() {
		return tcNotice;
	}

	public void setTcNotice(String tcNotice) {
		this.tcNotice = tcNotice;
	}

	public String getTcNoticeContent() {
		return tcNoticeContent;
	}

	public void setTcNoticeContent(String tcNoticeContent) {
		this.tcNoticeContent = tcNoticeContent;
	}

	public String getTcType() {
		return tcType;
	}

	public void setTcType(String tcType) {
		this.tcType = tcType;
	}

	public String getTcNoticeTime() {
		return tcNoticeTime;
	}

	public void setTcNoticeTime(String tcNoticeTime) {
		this.tcNoticeTime = tcNoticeTime;
	}

	public String getTcNoticeDepart() {
		return tcNoticeDepart;
	}

	public void setTcNoticeDepart(String tcNoticeDepart) {
		this.tcNoticeDepart = tcNoticeDepart;
	}

	public String getTcNoticePerson() {
		return tcNoticePerson;
	}
	
	public void setTcNoticePerson(String tcNoticePerson) {
		this.tcNoticePerson = tcNoticePerson;
	}

}
